<?php
class Controller extends CController {
	/**
	 * @var string the default layout for the controller view. Defaults to 'column1',
	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
	 */
	//	public $layout='column1';
	public $layout = '//../modules/install/views/layouts/main';
	/**
	 * @var array context menu items. This property will be assigned to {@link CMenu::items}.
	 */
	public $menu=array();
	/**
	 * @var array the breadcrumbs of the current page. The value of this property will
	 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
	 * for more details on how to specify this property.
	 */
	public $breadcrumbs=array();
	
	//public $defaultAction = 'admin';

	public $assetsUrl;
	public $imagesPath;
	public $cssPath;
	public $jsPath;

	public $pageHeader;

	/**
	 * @var string Current country code
	 */
	public $countryCode;

	public $debugMode = false;

	public $formId='formId';

	public function init(){
		
		$this->assetsUrl = $this->module->assetsUrl();
		
		$this->imagesPath = $this->assetsUrl . '/images';
		$this->cssPath = $this->assetsUrl . '/css';
		$this->jsPath = $this->assetsUrl . '/js';
		
		$this->debugMode = Yii::app()->params['debugMode'];
		//Yii::app()->language = 'zh_cn';
		$this->countryCode = Environment::isProduction()? Yii::app()->geoip->lookupCountryCode():Yii::app()->params['defaultCountryCode'];
		
		Yii::setPathOfAlias('componentsViewPath', $this->module->viewPath . '/widgets');
		
		//Lang::setModule($this->module->name);
		
		$this->pageTitle = CHtml::encode(Lang::t('app.title', array('{name}' => Yii::app()->name)));
	}//end function
	
}//end class